<script setup lang="ts">
defineProps({
  title: {
    type: String,
    default: 'Title'
  }
})
</script>

<template>
  <!-- echarts 的每个图表卡片 -->
  <div class="card">
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>{{ title }}</span>
        </div>
      </template>
      <div class="item">
        <!-- 这个默认插槽是放 baseEchart的 -->
        <slot></slot>
      </div>
    </el-card>
  </div>
</template>

<style scoped lang="less">
.box-card {
  &:deep(.el-card__header) {
    padding: 10px 20px !important;
  }
}
.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 30px;
}
.item {
  margin-bottom: 10px;
}
</style>
